<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function LoadAlbum()
{	
	 var oReq = new ActiveXObject("MSXML2.XMLHTTP.3.0");
      oReq.open("POST", "add_photo.php?action=GetAlbumList", false);
      oReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	 // var para="albumName="+albumName;
      oReq.send(null); 
	
	  //alert(oReq.responseText);
	  eval("albumList="+oReq.responseText);
	  var albumListDiv=document.getElementById("AlbumListDiv");
	  while(albumListDiv.lastChild!=null)
	  {
		  albumListDiv.removeChild(albumListDiv.lastChild);
	  }
	   
	  //动态加载相册列表
	  for(var i=0;i<albumList.length;i++)
	  {
		  var albumDiv=document.createElement("div");
		  albumDiv.style.padding="10px";
		  
		  albumDiv.innerText=albumList[i].name;
		  albumDiv.id=albumList[i].id;
		  //相册封面
		  var coverDiv=document.createElement("div");
		  coverDiv.style.width="200px";
		  coverDiv.style.padding="20px";
		  coverDiv.style.float="left";
		  coverDiv.style.cursor="pointer";
		  
		  coverDiv.id=albumList[i].id;
		  coverDiv.attachEvent("onclick",viewPhoto);
		  albumDiv.appendChild(coverDiv);
		  
		  //相册描述
		  var descDiv=document.createElement("div");
		  descDiv.style.width="300px";
		  albumDiv.appendChild(descDiv);
		  
		  //albumDiv.attachEvent("onclick","GetPhotoList");
		  
		  
		  albumListDiv.appendChild(albumDiv);  		  
	  }
}

function viewPhoto()
{
	var albumId=event.srcElement.id;
	window.location.href="photo_view.htm?albumId="+albumId;
}

</script>
</head>
<body onload="LoadAlbum()">
<div id="AlbumListDiv"></div>
</body>
</html>